<?php

namespace app\admin\model;

use think\Model;

class Cate extends Model
{

    protected $createTime = false;
    protected $updateTime = false;

    public function getcate($typez){
        return Cate::all(['typez' => $typez]);
    }

    public function addcate($data,$typez){
        $cateData = array();
        $cateData = [
            'catename' => $data['catename'],
            'type' => $data['type'],
            'keywords' => '1',
            'desc' => '1',
            'content' => '1',
            'rec_index' => '1',
            'rec_bottom' => '1',
            'pid' => '1',
            'sort' => '1',
            'typez' => $typez
        ];

        if($this->save($cateData)){
            return true;
        }else{
            return false;
        }
    }
}
